package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.EmployeeDto;
import edu.suda.xsap.entity.Employee;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")

public interface EmployeeConvert {
    @Mapping(source="name", target = "name")
    @Mapping(source="birthday", target = "birthday")
    @Mapping(source="sex", target = "sex")
    @Mapping(source="phone", target = "phone")
    @Mapping(source="note", target = "note")
    @Mapping(source="introduce", target = "introduce")
    @Mapping(source="id", target = "id")
    @Mapping(source="roleEmail", target = "roleEmail")
    EmployeeDto toDto(Employee employee) ;
    List<EmployeeDto> toDtoList(List<Employee> employees);

}
